
$("#refresh-docs").click(function(){tags.refreshTags();});
$("#user-id").text(bgPage.userId);
$("#album-id").text(bgPage.albumId);

chrome.tabs.executeScript(bgPage.tabId, 
  {
    file: 'js/inject.js'
  },
  function (data) {
      console.log('i am here');
      console.log(data);
      bgPage.selectedPhotoUrls = data[0].selectedPhotoUrls;
      bgPage.url = data[0].url;
      if (data[0].albumId) {
	  bgPage.albumId = data[0].albumId;
      }
      if (data[0].photoId) {
	  bgPage.photoId = data[0].photoId;
      }
}
);


//bgPage.photos = {};
//bgPage.selectedPhotos = {};
//bgPage.selectedTags = {};

photos.getDocumentList("https://picasaweb.google.com/data/feed/api/user/default/albumid/" + bgPage.albumId + "?kind=photo&access=all&alt=json");

$("#tagFilter").change( function () {
    tags.renderDocList();
}).keyup( function () {
  // fire the above change event after every letter
  $(this).change();
});

$("#apply-btn").click(function () {
    tags.apply();
});
